<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../../forms/resources/picker-common.js"></script>
<script src="resources/suggestion-picker-common.js"></script>
</head>
<body style="background-color: #bbbbbb;">
<p id="description"></p>
<div id="console"></div>
<input type=month id=month value="2012-12" min="2012-02" max="2012-05" list=suggestions>
<datalist id=suggestions>
    <option>2012-01</option>
    <option>2012-02</option>
    <option>2012-03</option>
    <option>2012-04</option>
    <option>2012-05</option>
    <option>2012-06</option>
    <option>2012-07</option>
    <option>2012-08</option>
    <option>2012-09</option>
    <option>2012-10</option>
</datalist>
<script>
description('Tests that min/max attributes filter out suggestions as expected.');

debug('Check that page popup doesn\'t exist at first.');
shouldBeNull('document.getElementById("mock-page-popup")');

openPicker(document.getElementById('month'), test);

function test() {
    popupWindow.focus();

    shouldBe('entryValues().length', '5');
    shouldBeEqualToString('entryValues()[0]', '2012-02');
    shouldBeEqualToString('entryValues()[1]', '2012-03');
    shouldBeEqualToString('entryValues()[2]', '2012-04');
    shouldBeEqualToString('entryValues()[3]', '2012-05');
    shouldBeEqualToString('entryValues()[4]', '@openCalendarPicker');

    finishJSTest();
}

</script>
</body>
</html>
